package com.zsl.swing.redis.desktop.window.menu;

import com.zsl.swing.redis.desktop.type.MainMenuEnum;
import com.zsl.swing.redis.desktop.window.panel.ZslConnectionPanel;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class ZslServerMenu extends ZslMenu implements ActionListener {


    public ZslServerMenu(){
        super(MainMenuEnum.SERVERS.getText());

        this.add(ZslMenuItem.getInstance(MainMenuEnum.ADD.getText(),this));
        this.add(ZslMenuItem.getInstance(MainMenuEnum.UPDATE.getText(),this));
        this.add(ZslMenuItem.getInstance(MainMenuEnum.READ.getText(),this));
        this.add(ZslMenuItem.getInstance(MainMenuEnum.DELETE.getText(),this));

    }

    @Override
    public void actionPerformed(ActionEvent e) {
        ZslConnectionPanel.doActionForMenu(e.getActionCommand());
    }
}
